package com.epam.lunch.service;

import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.List;

import javax.annotation.Resource;

import com.epam.lunch.domain.Food;
import com.epam.lunch.domain.Restaurant;

@Resource
public class SystemOutMenuLister implements MenuLister{

	private RestaurantRepository repo;
	
	public SystemOutMenuLister(RestaurantRepository repo) {
		this.repo = repo;
	}

	@Override
	public void listMenus() {
		List<Restaurant> allRestaurants = repo.getAllRestaurants();
		for (Restaurant restaurant : allRestaurants) {
			System.out.println("next Restaurant: " + restaurant);
			for (Food food : restaurant.getMenu().getFoods()) {
				System.out.println("    " + food);
			}
		}
		
	}
	
	private String tellSecret() {
		return "nyancat";
	}

}
